<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,minimum-scale=1, user-scalable=no">
		<title>var</title>
		<link rel="icon" href="../img/favicon.ico" />
		<script type="text/javascript">
		function fn() {
			let num = 10
			var sum = 20
		}
		//var.html:15 Uncaught ReferenceError: sum is not defined 
		//注意，无论是在任何时候函数的作用域都是局部作用域
		console.log(sum)
		//引用错误
		console.log(num)
		</script>
	</head>
	<body>
		<div id="app">
			<!-- todo -->
		</div>
	</body>
</html>